package video.threaddemo.callable;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class CallableMain {

    public static void main(String[] args) throws Exception {
        ExecutorService threadExecutor = Executors.newSingleThreadExecutor();
        Future<String> submit = threadExecutor.submit(new CallableDemo("i'm fine,Thank you"));

        System.out.println(submit.isDone());
        System.out.println(submit.isCancelled());
        String s = submit.get();
        System.out.println(s);

        threadExecutor.shutdownNow();
    }
}
